;;;; Math section
;;;; Convert from gallons to drums
;;;; (technically the same. 1 drum == about 50-55 gallons)
;;;;
;;
;;
;; Priority is that the math is done so no
;; small incremental errors pop up over time (due to
;; conversions from one qty to another and back).
;;
;;


(setf *frame_math_main* (make-instance 'frame  :width 20
					       :height 10
					       :master *frame_math*))
(configure *frame_math_main* :borderwidth 0 :relief :raised)

(grid *frame_math_main* 0 0 :sticky "we")

(grid-rowconfigure    *frame_math_main* 0 :weight 1)
(grid-rowconfigure    *frame_math_main* 1 :weight 1)
(grid-rowconfigure    *frame_math_main* 2 :weight 1)
(grid-rowconfigure    *frame_math_main* 3 :weight 1)
(grid-rowconfigure    *frame_math_main* 4 :weight 1)
(grid-rowconfigure    *frame_math_main* 5 :weight 1)
(grid-columnconfigure *frame_math_main* 0 :weight 1)

(setf math_label_top (make-instance 'label :master *frame_math_main*
					   :text "Adjust Qty."))
(grid math_label_top 0 0 :columnspan 3)

(setf math_label_btm (make-instance 'label :master *frame_math_main*
					   :text "This will convert from whatever 
is entered into the first box,
 to the second value, for the 
current entry display"))
(grid math_label_btm 4 0 :columnspan 3)



(setf math_label_initial (make-instance 'label :master *frame_math_main*
					       :text "Initial:"))
(setf math_label_new (make-instance 'label :master *frame_math_main*
					   :text "New qty:"))
(grid math_label_initial 1 0)
(grid math_label_new     2 0)


(defvar *math_entry_initial* 0)
(setf *math_entry_initial* (make-instance 'entry
  					  :master *frame_math_main*
					  :width 5))
(grid *math_entry_initial* 1 1 :sticky"w")

(defvar *math_entry_new* 0)
(setf *math_entry_new* (make-instance 'entry
  				      :master *frame_math_main*
				      :width 5))
(grid *math_entry_new* 2 1 :sticky"w")


(defvar math_combobox_1 "")
(defvar math_combobox_2 "")
(setf math_combobox_1 (make-instance 'combobox :values '(gallons drums) :master *frame_math_main*))
(setf math_combobox_2 (make-instance 'combobox :values '(gallons drums) :master *frame_math_main*))
(configure math_combobox_1 :width 8)
(configure math_combobox_2 :width 8)
(grid math_combobox_1 1 2 :pady 10)
(grid math_combobox_2 2 2 :pady 10)

;; (bind cb2 "<<ComboboxSelected>>"                                ; 2
;;      (lambda (evt) (format t "cb2 is now ~a~%" (text cb2)))))



(defvar *math_btn* "")
(setf *math_btn* (make-instance 'button :text "Submit"
					      :command #'(lambda () (printout))
					      :master *frame_math_main*))
(grid *math_btn* 5 0 :columnspan 3 :pady 2)
